package com.fxc;

import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;

public class ResourceManager {
	public static BufferedImage p1tankL, p1tankU, p1tankR, p1tankD;
	
	public static BufferedImage p2tankL, p2tankU, p2tankR, p2tankD;
	
	public static BufferedImage bullet;
	
	public static BufferedImage[]  explods = new BufferedImage[16];
	
	static {
		try {
			
			// p1tank图片
			p1tankL = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("source/img/p1tankL.gif"));
			p1tankU = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("source/img/p1tankU.gif"));
			p1tankR = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("source/img/p1tankR.gif"));
			p1tankD = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("source/img/p1tankD.gif"));
			
			// p2tank图片
			p2tankL = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("source/img/p2tankL.gif"));
			p2tankU = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("source/img/p2tankU.gif"));
			p2tankR = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("source/img/p2tankR.gif"));
			p2tankD = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("source/img/p2tankD.gif"));
			
			// 子弹图片
			bullet = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("source/img/enemymissile.gif"));
			
			// 爆炸动画
			for (int i = 0; i < 8; i++) {
				explods[i] = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("source/img/blast"+(i +1)+".gif" ));
			}
			// System.out.println(explods);
			///TakeGame/src/source/img/blast1.gif
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
